#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
//size_t my_strlen(const char* s)
//{
//	assert(s);
//	int count = 0;
//	while (*s != '\0')
//	{
//		count++;
//		s++;
//	}
//	return count;
//}
//int main()
//{
//	char arr[] = { "abcdefg" };
//	size_t len =  my_strlen(arr);
//	printf("%zd", len);
//}
//char* my_strcpy(char* dest, const char* src)
//{
//	assert(dest != NULL);
//	assert(src != NULL);
//	char* ret = dest;
//	while (*dest++ = *src++)
//		;
//	return ret;
//}
//int main()
//{
//	char arr1[] = { "abcdefg" };
//	char arr2[20] = { "xxxxxxxxxxxxx" };
//	char* ret = my_strcpy(arr2, arr1);
//	printf("%s", ret);
//}
char* my_strcat(char* dest, const char* src)
{
	assert(dest && src);
	char* ret = dest;
	while (*dest != '\0')
		dest++;
	while (*dest++ = *src++)
		;
	return ret;
}
int main()
{
	char arr1[] = {"hello"};
	char arr2[] = {"world"};
	char* ret = my_strcat(arr1, arr2);
	printf("%s\n", arr1);
	printf("%s\n", arr2);
	printf("%s\n", ret);
}